package com.yangxk.server;

import com.yangxk.foo.handle.ConnectorHandler;
import com.yangxk.foo.handle.ConnectorStringPacketChain;
import com.yanxk.library.clink.box.StringReceivePacket;

public class ServerStatistics {
    long receiveSize;
    long sendSize;

    ConnectorStringPacketChain statisticsChain() {
        return new StatisticsConnectorStringPacketChain();
    }

    class StatisticsConnectorStringPacketChain extends ConnectorStringPacketChain {

        @Override
        protected boolean consume(ConnectorHandler handler, StringReceivePacket stringReceivePacket) {
            // 接收数据量自增
            receiveSize++;
            return false;
        }
    }
}
